Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hebcal/geo-sqlite

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hebcal/geo-sqlite

Hebcal ES6 interface to GeoNames and USA ZIP code SQLite databases

  • 2.4.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

hebcal-geo-sqlite

Hebcal ES6 interface to GeoNames and USA ZIP code SQLite databases

This package is designed for the hebcal.com and may not be generally reusable. It requires two separate databases, one made from GeoNames.org data (available via a Creative Commons license) and a USA ZIP code database (commercial license).

Installation

$ npm install @hebcal/geo-sqlite

Synopsis

import {Location} from '@hebcal/core';
import {GeoDb} from '@hebcal/geo-sqlite';
import pino from 'pino';
const logger = pino();

const db = new GeoDb(logger, 'zips.sqlite3', 'geonames.sqlite3');
const loc1 = db.lookupZip('90210'); // Beverly Hills, California
const loc2 = db.lookupGeoname(293397); // Tel Aviv
const loc3 = db.lookupLegacyCity('IL-Netanya');
db.close();

Classes

GeoDb

Wrapper around sqlite databases

GeoDb

Wrapper around sqlite databases

Kind: global class

new GeoDb(logger, zipsFilename, geonamesFilename)

ParamType
loggerany
zipsFilenamestring
geonamesFilenamestring

geoDb.close()

Closes database handles

Kind: instance method of GeoDb

geoDb.lookupZip(zip) ⇒ Location

Kind: instance method of GeoDb

ParamType
zipstring

geoDb.lookupGeoname(geonameid) ⇒ Location

Kind: instance method of GeoDb

ParamType
geonameidnumber

geoDb.lookupLegacyCity(cityName) ⇒ Location

Kind: instance method of GeoDb

ParamType
cityNamestring

Keywords

FAQs

Package last updated on 21 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc